Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRAFT: Extend with recaptcha v3 #373

Closed
wants to merge 14 commits into from
Closed

DRAFT: Extend with recaptcha v3 #373

wants to merge 14 commits into from

Conversation

Quehnie
Copy link
Contributor

@Quehnie Quehnie commented Nov 28, 2023

Q A
Bug fix? yes
New feature? yes
BC breaks? no
Deprecations? no
License MIT

What's in this PR?

The correct way to use EWZ Recaptcha v3 with sulu form bundle

Why?

EWZ Recaptcha V3 was not loaded correctly.

Example Usage

ewz_recaptcha:
    version: 3 # default 2.

To Do

  • Update documentation

Dynamic/Types/RecaptchaType.php Outdated Show resolved Hide resolved
Resources/config/type_recaptcha.xml Outdated Show resolved Hide resolved
@mario-fehr
Copy link

mario-fehr commented Dec 1, 2023

@Quehnie @alexander-schranz Does this replace #358?

Comment on lines +61 to +67
if ($this->params->has('ewz_recaptcha.version')
&& 3 == $this->params->get('ewz_recaptcha.version')
) {
$constraint = new \EWZ\Bundle\RecaptchaBundle\Validator\Constraints\IsTrueV3();
$type = \EWZ\Bundle\RecaptchaBundle\Form\Type\EWZRecaptchaV3Type::class;
unset($options['attr']);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Quehnie This should be done in a compilerpass. There you have access to the ewz_recpatcha.version even the bundle is registered after the form bundle:

And then you can set a sulu_form.recaptcha_version parameter which you use in type_reacptacha.xml

@Quehnie Quehnie closed this by deleting the head repository Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants